﻿<?xml version="1.0" encoding="utf-8" ?>
<!-- Application層のDriveControl Argorithm用VC++プロジェクト生成用レシピ -->
<!-- Author: Tomonori Fukuta -->
<Recipe Name="CreateDriveControlVCPPProject" Bound="false" xmlns="http://schemas.microsoft.com/pag/gax-core">
  <Types>
    <TypeAlias Name="Evaluator" Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" />
  </Types>
  <Caption>Create DriveControl Argorithm VC++ Project</Caption>
  <HostData>
    <Icon ID="680"/>
    <CommandBar Name="Solution Folder"/>
  </HostData>
  <Arguments>
    <Argument Name="ProjectName" Type="System.String">
    </Argument>
    <Argument Name="IncDirs" Type="System.String[]">
      <ValueProvider Type="EEst.SoftwareFactory.ValueProviders.CoreIncDirsValueProvider, PathfinderSoftwareFactory"
             />
    </Argument>
    <Argument Name="FileProvider" Type="EEst.SoftwareFactory.ValueProviders.VCPPProjectFileProvider, PathfinderSoftwareFactory">
      <ValueProvider Type="EEst.SoftwareFactory.ValueProviders.GenAppFilesValueProvider, PathfinderSoftwareFactory"
             />
    </Argument>
    <Argument Name="SrcFiles" Type="System.String[]">
      <ValueProvider Type="Evaluator"
         Expression="$(FileProvider.SourceFiles)" />
    </Argument>
    <Argument Name="HdrFiles" Type="System.String[]">
      <ValueProvider Type="Evaluator"
         Expression="$(FileProvider.HeaderFiles)" />
    </Argument>
    <Argument Name="CurrentFolder" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.FirstSelectedProject, Microsoft.Practices.RecipeFramework.Library" />
    </Argument>
    <Argument Name="SourceFileType">
      <ValueProvider Type="Evaluator" Expression="Source"/>
    </Argument>
    <Argument Name="HeaderFileType">
      <ValueProvider Type="Evaluator" Expression="Header"/>
    </Argument>
    <Argument Name="ProjectType">
      <ValueProvider Type="Evaluator" Expression="DriveControl"/>
    </Argument>
    <Argument Name="XCConfigFileName">
      <ValueProvider Type="Evaluator" Expression="XCConfig.xml"/>
    </Argument>
    <Argument Name="VS" Type="EnvDTE.DTE, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <ValueProvider Type="EEst.SoftwareFactory.ValueProviders.EnvDTEValueProvider, PathfinderSoftwareFactory"/>
    </Argument>
    <Argument Name="VSVersion" Type="System.String">
      <ValueProvider Type="Evaluator" Expression="$(VS.Version)"></ValueProvider>
    </Argument>
    <Argument Name="RelativePath" Type="System.String">
      <ValueProvider Type="Evaluator" Expression=".\..\..\..\"/>
    </Argument>
    <Argument Name="AppPath" Type="System.String">
      <ValueProvider Type="Evaluator" Expression="..\..\."/>
    </Argument>
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page>
          <Title>Specify DriveControl Project Name</Title>
          <Fields>
            <Field Label="DriveControl Project Name" ValueName="ProjectName"/>
          </Fields>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions>
    <!-- VC++ Project Fileの生成及びSolutionへの追加 -->
    <Action Name="GetXCConfig" Type="EEst.SoftwareFactory.Actions.GetXCConfigAction, PathfinderSoftwareFactory">
      <Output Name="CygwinHome"/>
      <Output Name="BrickOSHome"/>
      <Output Name="H8ToolsHome"/>
    </Action>
    <Action Name="ItemContent"
            Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
            Template="Text\VCProjExt.vcproj.t4">
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="IncDirs" RecipeArgument="IncDirs" />
      <Input Name="Sources" RecipeArgument="SrcFiles" />
      <Input Name="Headers" RecipeArgument="HdrFiles" />
      <Input Name="Version" RecipeArgument="VSVersion" />
      <Output Name="Content" />
    </Action>
    <Action Name="CreateVCPPProjFile" Type="EEst.SoftwareFactory.Actions.CreateVCPProjectByT4Action, PathfinderSoftwareFactory">
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="FileContent" ActionOutput="ItemContent.Content"/>
      <Output Name="ProjectFileName"/>
      <Output Name="TargetFolder"/>
    </Action>
    <Action Name="AddProjFileToSolution" Type="EEst.SoftwareFactory.Actions.AddProjectToSolutionFolderAction, PathfinderSoftwareFactory">
      <Input Name="SolutionProject" ActionOutput="CreateVCPPProjFile.TargetFolder"/>
      <Input Name="ProjectFile" ActionOutput="CreateVCPPProjFile.ProjectFileName"/>
      <Output Name="AddedProject"/>
    </Action>
    <Action Name="XCConfigXMLFileContent" Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
    Template="Text\XCConfig.xml.t4">
      <Input Name="CygwinHome" ActionOutput="GetXCConfig.CygwinHome"/>
      <Input Name="BrickOSHome" ActionOutput="GetXCConfig.BrickOSHome"/>
      <Input Name="H8ToolsHome" ActionOutput="GetXCConfig.H8ToolsHome"/>
      <Input Name="TargetName" RecipeArgument="ProjectName"/>
      <Input Name="RelativePath" RecipeArgument="RelativePath"/>
      <Input Name="AppPath" RecipeArgument="AppPath"/>
      <Output Name="Content"/>
    </Action>
    <Action Name="AddXCConfigXMLFile" Type="Microsoft.Practices.RecipeFramework.Library.Actions.AddItemFromStringAction, Microsoft.Practices.RecipeFramework.Library">
      <Input Name="Project" ActionOutput="AddProjFileToSolution.AddedProject" />
      <Input Name="Content" ActionOutput="XCConfigXMLFileContent.Content"/>
      <Input Name="TargetFileName" RecipeArgument="XCConfigFileName"/>
    </Action>
    <!-- DriveControlクラスのファイル名を取得 -->
    <Action Name="GetDriveControlFilePolicy" Type="EEst.SoftwareFactory.Actions.AppProjectPolicyAction, PathfinderSoftwareFactory">
      <Input Name="ProjectName" RecipeArgument="ProjectName" />
      <Input Name="ProjectType" RecipeArgument="ProjectType"/>
      <Output Name="SourceFileName"/>
      <Output Name="HeaderFileName"/>
      <Output Name="BlackBoardFileName"/>
    </Action>
    <!-- BlackBoard Class creation and adding to project -->
    <Action Name="BlackBoardDC" Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
            Template="Text\CPPFiles\DCBlackBoard.h.t4">
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Output Name="Content"/>
    </Action>
    <Action Name="AddBBHeaderToProject" Type="Microsoft.Practices.RecipeFramework.Library.Actions.AddItemFromStringAction, Microsoft.Practices.RecipeFramework.Library">
      <Input Name="Project" ActionOutput="AddProjFileToSolution.AddedProject" />
      <Input Name="Content" ActionOutput="BlackBoardDC.Content"/>
      <Input Name="TargetFileName" ActionOutput="GetDriveControlFilePolicy.BlackBoardFileName" />
    </Action>
    <!-- DriveControlクラスのソースファイル生成とプロジェクトへの追加 -->
    <Action Name="DriveControlCPPContent"
    Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
    Template="Text\CPPFiles\DriveControl.hcpp.t4">
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="FileType" RecipeArgument="SourceFileType" />
      <Output Name="Content" />
    </Action>
    <Action Name="AddSourceToProject" Type="Microsoft.Practices.RecipeFramework.Library.Actions.AddItemFromStringAction, Microsoft.Practices.RecipeFramework.Library">
      <Input Name="Project" ActionOutput="AddProjFileToSolution.AddedProject" />
      <Input Name="Content" ActionOutput="DriveControlCPPContent.Content"/>
      <Input Name="TargetFileName" ActionOutput="GetDriveControlFilePolicy.SourceFileName" />
    </Action>
    <!-- DriveControlクラスのヘッダーファイル生成とプロジェクトへの追加 -->
    <Action Name="DriveControlHContent"
    Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
    Template="Text\CPPFiles\DriveControl.hcpp.t4">
      <Input Name="ProjectName" RecipeArgument="ProjectName"/>
      <Input Name="FileType" RecipeArgument="HeaderFileType" />
      <Output Name="Content" />
    </Action>
    <Action Name="AddHeaderToProject" Type="Microsoft.Practices.RecipeFramework.Library.Actions.AddItemFromStringAction, Microsoft.Practices.RecipeFramework.Library">
      <Input Name="Project" ActionOutput="AddProjFileToSolution.AddedProject" />
      <Input Name="Content" ActionOutput="DriveControlHContent.Content"/>
      <Input Name="TargetFileName" ActionOutput="GetDriveControlFilePolicy.HeaderFileName" />
    </Action>
  </Actions>
</Recipe>
